package com.ss.android.wenda.answer.detail2;

import android.view.View;
import com.ss.android.article.base.feature.app.schema.AdsAppActivity;
import com.ss.android.article.base.feature.detail2.h;
import com.ss.android.common.lib.MobClickCombiner;

final class ap implements View.OnClickListener {
    private final NewAnswerDetailFragment a;

    ap(NewAnswerDetailFragment arg1) {
        this.a = arg1;

    }

    public final void onClick(View arg4) {
        if((this.a.getContext() instanceof h)) {
            MobClickCombiner.onEvent(this.a.getContext(), ((h)this.a.getContext()).l(), "header_clicked");
        }

        String v0 = NewAnswerDetailFragment.l(this.a).optString("enter_from");
        if(("click_answer".equals(v0)) || ("click_answer_fold".equals(v0))) {
            this.a.getActivity().finish();
        }
        else if(this.a.mArticleDetail != null && !android.support.design.a.isTextEmpty(this.a.mArticleDetail.qid)) {
            AdsAppActivity.openUrl(this.a.getActivity(), NewAnswerDetailFragment.m(this.a), null);
        }
    }
}

